package MYarray;

public class nm1 {
    public static void main(String[] args){
        //传递Integer类型的数据进行泛型练习；
        MyArray<Integer> myArray=new MyArray<>();
        myArray.setArray(0,1);
        myArray.setArray(1,1);
        Integer a= myArray.getArray(1);
        System.out.println(a);
        System.out.println("============");
       // myArray.setArray(2,"hello");
        //传递String类型的数据对泛型的练习；
        MyArray<String> myArray1=new MyArray<>();
        myArray1.setArray(1,"hello");
        myArray1.setArray(2,"world");
        String str1= myArray1.getArray(1);
        String str2= myArray1.getArray(2);
        System.out.println(str1+str2);

    }
    public static void main1(String[] args){
        MyArray<String> myArray=new MyArray();
        System.out.println(myArray);


    }
   /* public static void main1(String[]args){
        MyArray myArray=new MyArray();
        myArray.setArray(0,1);
        myArray.setArray(1,2);
        Integer integer=myArray.getArray(1);
        Integer integer1=myArray.getArray(0);
        System.out.println(myArray);
    }*/
}
